﻿using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace config3
{
    internal class TestWebConfig
    {
        private readonly IOptionsSnapshot<WebConfig> optionsSnapshotConfig;

        public TestWebConfig(IOptionsSnapshot<WebConfig> optionsSnapshotConfig)
        {
            this.optionsSnapshotConfig = optionsSnapshotConfig;
        }

        public void test()
        {
            Console.WriteLine(this.optionsSnapshotConfig.Value.conn1.ProviderName);
            Console.WriteLine(this.optionsSnapshotConfig.Value.Config.database);
        }
    }
}
